#!/bin/sh

echo "Testing $@:"

rm tmp/* > /dev/null 2>&1

fail() {
   echo "ERROR - " $@
   exit 1
}

for file in tests/*.sh
do 
   echo -n " o $file: "
   EXIT=0
   for try in $(seq 40);
   do
      $file $@
      EXIT=$?
      test $EXIT -eq 0 && break;
   done
   test $EXIT -eq 0 || { echo "ERROR"; fail "test $file fails"; }
   echo "ok"
done

